package com.wuliu.system.service.impl;

import java.util.List;
import com.wuliu.common.utils.DateUtils;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.wuliu.system.mapper.TspDrivingDetailMapper;
import com.wuliu.system.domain.TspDrivingDetail;
import com.wuliu.system.service.ITspDrivingDetailService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 行车记录运单明细Service业务层处理
 * 
 * @author realue
 * @date 2023-11-04
 */
@Service
public class TspDrivingDetailServiceImpl extends ServiceImpl<TspDrivingDetailMapper, TspDrivingDetail> implements ITspDrivingDetailService {
    @Resource
    private TspDrivingDetailMapper tspDrivingDetailMapper;

    /**
     * 查询行车记录运单明细
     * 
     * @param id 行车记录运单明细主键
     * @return 行车记录运单明细
     */
    @Override
    public TspDrivingDetail selectTspDrivingDetailById(String id) {
        return tspDrivingDetailMapper.selectTspDrivingDetailById(id);
    }

    /**
     * 查询行车记录运单明细列表
     * 
     * @param tspDrivingDetail 行车记录运单明细
     * @return 行车记录运单明细
     */
    @Override
    public List<TspDrivingDetail> selectTspDrivingDetailList(TspDrivingDetail tspDrivingDetail) {
        return tspDrivingDetailMapper.selectTspDrivingDetailList(tspDrivingDetail);
    }

    /**
     * 新增行车记录运单明细
     * 
     * @param tspDrivingDetail 行车记录运单明细
     * @return 结果
     */
    @Override
    public int insertTspDrivingDetail(TspDrivingDetail tspDrivingDetail) {
        tspDrivingDetail.setCreateTime(DateUtils.getNowDate());
        return tspDrivingDetailMapper.insertTspDrivingDetail(tspDrivingDetail);
    }

    /**
     * 修改行车记录运单明细
     * 
     * @param tspDrivingDetail 行车记录运单明细
     * @return 结果
     */
    @Override
    public int updateTspDrivingDetail(TspDrivingDetail tspDrivingDetail) {
        tspDrivingDetail.setUpdateTime(DateUtils.getNowDate());
        return tspDrivingDetailMapper.updateTspDrivingDetail(tspDrivingDetail);
    }

    /**
     * 批量删除行车记录运单明细
     * 
     * @param ids 需要删除的行车记录运单明细主键
     * @return 结果
     */
    @Override
    public int deleteTspDrivingDetailByIds(String[] ids) {
        return tspDrivingDetailMapper.deleteTspDrivingDetailByIds(ids);
    }

    /**
     * 删除行车记录运单明细信息
     * 
     * @param id 行车记录运单明细主键
     * @return 结果
     */
    @Override
    public int deleteTspDrivingDetailById(String id) {
        return tspDrivingDetailMapper.deleteTspDrivingDetailById(id);
    }
}
